Learning Objectives

After completing this lesson, you'll be able to:

In this lesson, you will:

Learning Objectives

After completing this lesson, you'll be able to:

In this lesson, you will:

Resources

Controlling Workflows with Parameters

FME Flow Automations rely on sending messages between triggers and actions. When configuring triggers and actions, you use parameters to customize how they run and process data. For example, an FME Flow Schedule trigger has parameters for the Schedule Type and how often the schedule should run, which you provide values to control how the trigger functions. 

When you configure a Run a Workspace action, the workspace's user parameters appear, allowing you to customize its behavior. 

The values you enter for a trigger's or an action's parameters will control how the node runs. The value you enter will depend on the parameter type and what FME Flow expects as input for the parameter. For example, FME Flow has you pick a connection for a connection parameter. Source and destination dataset parameters accept file paths or URLs to web-based datasets. 

Automation Parameters

Automation Parameters are global to an automation. They allow you to reference a value multiple times at multiple components of your workflow without explicitly defining it each time. 

You create and edit automation parameters in the Automation Parameters Editor, which you open from the automations toolbar.

You may also open the editor to create Automation Parameters directly from parameter inputs. 

Every automation parameter begins with the global. prefix followed by the parameter name. When you reference this key, FME Flow will use the value saved to the parameter. For example, you create the SourceDataset_SHAPEFILE parameter that you will use in a source dataset parameter for a workspace. For the workspace source dataset parameter, you enter global.SourceDataset_SHAPEFILE, and the workspace will read from the file path value. 

Automation Parameters are reusable throughout an automation. You may reference them multiple times across multiple nodes. If the value changes, update it in the Automation Parameters Editor, and your workflow uses the new value anywhere it references the parameter. You do not have to update a value multiple times across your automation, which helps prevent errors if you forget to update a parameter. 

Output Attributes

Automations function by passing JSON-formatted messages between components and nodes. When a trigger receives a message to kick off the automation, it passes the message to the next action, triggering it to run. Once the action completes, it passes another message to the following actions. While it is possible to parse key pieces of information from the entire JSON message, FME Flow makes this task easier by extracting key-value pairs from the JSON messages and creating attributes. In automations, you can link these attributes to parameter values in downstream actions to further control how they function based on information from upstream in the automation. 

Each trigger and action has pre-set Output Attributes, called Event Attributes, specific to its type. You may reference Output Attributes in action parameters downstream from the trigger or action that creates the attribute. Be cautious if multiple actions produce the same attribute values - FME Flow only stores one value per attribute, so the value from the second action will overwrite the value from the first. If you need values from multiple actions, create Custom Attributes and provide a unique key for each action. Custom Attributes are Output Attributes you define manually, meaning you make the attribute name and assign a value to it. 

Exercise

Note

This exercise uses the Incoming Building Footprints Automation from the previous exercise, Create a Directory Watch Trigger. You should complete the previous exercise before completing this exercise.

Jennifer continues with her Incoming Building Footprints automation. So far, you've helped Jennifer trigger the automation when someone adds or updates files in the BuildingUpdates folder. Now, Jennifer needs to use a Filter messages action and a Run a Workspace action to process each shapefile and update the geodatabase. 

In this exercise, you will: 

1) Open and Run Starting Workspace

2) Publish to FME Flow

The workspace processes the building updates as expected, so it is ready to deploy to FME Flow.

3) Upload Geodatabase

Note

If the buildingfootprints.gdb already exists in Resources > Data > Output, you may skip this step and move on to Step 4. 

When you ran the workspace on FME Workbench, FME wrote the destination geodatabase to the local computer. Jennifer wants others to be able to access the geodatabase containing all the building updates for their workflows on FME Flow.

4) Stop Automation

5) Filter Messages

6) Add a Workspace Action

Next, configure the workspace parameters.

7) Start Automation

8) Test Automation

9) View Triggered Jobs

Now, check the job of the workspace that ran in the automation. 

The FME Flow Jobs page opens and shows the jobs completed by this automation. Notice whether your workspace ran successfully.  

10) Optional: Inspect Output

Note

The building footprints data you see will depend on which shapefiles you uploaded for processing. 

Inspect the output

You've now completely automated the building updates workflow for Jennifer. When someone adds new shapefiles to the BuildingUpdates folder, the automation triggers and runs the workspace that updates the geodatabase with the latest data. This automation eliminates Jennifer's need to process the shapefiles manually and ensures that other users can access the most up-to-date data. 

Resources

Controlling Workflows with Parameters

FME Flow Automations rely on sending messages between triggers and actions. When configuring triggers and actions, you use parameters to customize how they run and process data. For example, an FME Flow Schedule trigger has parameters for the Schedule Type and how often the schedule should run, which you provide values to control how the trigger functions. 

When you configure a Run a Workspace action, the workspace's user parameters appear, allowing you to customize its behavior. 

The values you enter for a trigger's or an action's parameters will control how the node runs. The value you enter will depend on the parameter type and what FME Flow expects as input for the parameter. For example, FME Flow has you pick a connection for a connection parameter. Source and destination dataset parameters accept file paths or URLs to web-based datasets. 

Automation Parameters

Automation Parameters are global to an automation. They allow you to reference a value multiple times at multiple components of your workflow without explicitly defining it each time. 

You create and edit automation parameters in the Automation Parameters Editor, which you open from the automations toolbar.

You may also open the editor to create Automation Parameters directly from parameter inputs. 

Every automation parameter begins with the global. prefix followed by the parameter name. When you reference this key, FME Flow will use the value saved to the parameter. For example, you create the SourceDataset_SHAPEFILE parameter that you will use in a source dataset parameter for a workspace. For the workspace source dataset parameter, you enter global.SourceDataset_SHAPEFILE, and the workspace will read from the file path value. 

Automation Parameters are reusable throughout an automation. You may reference them multiple times across multiple nodes. If the value changes, update it in the Automation Parameters Editor, and your workflow uses the new value anywhere it references the parameter. You do not have to update a value multiple times across your automation, which helps prevent errors if you forget to update a parameter. 

Output Attributes

Automations function by passing JSON-formatted messages between components and nodes. When a trigger receives a message to kick off the automation, it passes the message to the next action, triggering it to run. Once the action completes, it passes another message to the following actions. While it is possible to parse key pieces of information from the entire JSON message, FME Flow makes this task easier by extracting key-value pairs from the JSON messages and creating attributes. In automations, you can link these attributes to parameter values in downstream actions to further control how they function based on information from upstream in the automation. 

Each trigger and action has pre-set Output Attributes, called Event Attributes, specific to its type. You may reference Output Attributes in action parameters downstream from the trigger or action that creates the attribute. Be cautious if multiple actions produce the same attribute values - FME Flow only stores one value per attribute, so the value from the second action will overwrite the value from the first. If you need values from multiple actions, create Custom Attributes and provide a unique key for each action. Custom Attributes are Output Attributes you define manually, meaning you make the attribute name and assign a value to it. 

Exercise

Note

This exercise uses the Incoming Building Footprints Automation from the previous exercise, Create a Directory Watch Trigger. You should complete the previous exercise before completing this exercise.

Jennifer continues with her Incoming Building Footprints automation. So far, you've helped Jennifer trigger the automation when someone adds or updates files in the BuildingUpdates folder. Now, Jennifer needs to use a Filter messages action and a Run a Workspace action to process each shapefile and update the geodatabase. 

In this exercise, you will: 

1) Open and Run Starting Workspace

2) Publish to FME Flow

The workspace processes the building updates as expected, so it is ready to deploy to FME Flow.

3) Upload Geodatabase

Note

If the buildingfootprints.gdb already exists in Resources > Data > Output, you may skip this step and move on to Step 4. 

When you ran the workspace on FME Workbench, FME wrote the destination geodatabase to the local computer. Jennifer wants others to be able to access the geodatabase containing all the building updates for their workflows on FME Flow.

4) Stop Automation

5) Filter Messages

6) Add a Workspace Action

Next, configure the workspace parameters.

7) Start Automation

8) Test Automation

9) View Triggered Jobs

Now, check the job of the workspace that ran in the automation. 

The FME Flow Jobs page opens and shows the jobs completed by this automation. Notice whether your workspace ran successfully.  

10) Optional: Inspect Output

Note

The building footprints data you see will depend on which shapefiles you uploaded for processing. 

Inspect the output

You've now completely automated the building updates workflow for Jennifer. When someone adds new shapefiles to the BuildingUpdates folder, the automation triggers and runs the workspace that updates the geodatabase with the latest data. This automation eliminates Jennifer's need to process the shapefiles manually and ensures that other users can access the most up-to-date data.